//
//  CacheManager.h
//  XtuanMoive
//
//  Created by ppl on 14-11-19.
//  Copyright (c) 2014年 X团. All rights reserved.
//

#import <Foundation/Foundation.h>

enum {
    CacheFlagDefault = 0,
    CacheFlagPermanent = 1 //持久化储存
};

typedef enum : NSUInteger {
    CacheManagerTypeSDWebImage = 1, //sdwebImage 缓存
    CacheManagerTypeSQL = 2, // 本地数据化缓存
} CacheManagerType;

@interface CacheManager : NSObject

+ (CacheManager *)sharedCacheManager;

- (void)setCache:(NSString *)key value:(NSData *)value flag:(int)flag;
- (NSData *)cache:(NSString *)key timeout:(NSTimeInterval)timeout;
- (void)removeCache:(NSString *)key withType:(CacheManagerType)type;
- (void)clear;

@end
